<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		

		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		<div id="app">
			<h1>通过style设置样式</h1>
			<div style="color: red;font-size: 17px;">Hello world！</div>
		    <h1>vue绑定style设置样式</h1>
			<div :style="styleObject">Hello world！</div>
			<input type="text" v-model.lazy="styleObject.color" /><br>
			<input type="text" v-model.lazy="styleObject.fontSize" /><br>
			<input type="color" v-model="styleObject.color" /><br>
		<!-- 	<button @click="">+</button>
			<button @click="">-</button> -->
		</div>
		
		<script>
			// styleObject中的属性名要符合css里命名
			var app = Vue.createApp({
				data(){
					return {
						styleObject:{
							color:'red',
							fontSize:'27px'
						}
						// textColor: 'red',
						// size: 17
					}
				}
			});
			var vm = app.mount("#app")	
		</script>
	</body>
</html>
